/**
*@Author: QWP
*@Description: 我的日程相关接口
*@Date 2024-08-06 19:04
*/
import request from '@/http'

// 上传
export const upload = async (data: object, config?: object) => {
  return new Promise(async (resolve, reject) => {
    const res = await request.upload({
      url: '/file/file/anyone/upload',
      data: data,
      ...(config || {})
    })
    setTimeout(() => resolve(res), 500)
  })
}

// 附件下载: 根据id下载
export const downloads = async (data: object) => {
  return await request.download1({
    url: '/file/file/downloads',
    data: data,
  })
}

// 附件下载: 根据id下载
export const downloads1 = async (data: object) => {
  return await request.get({
    url: '/api/file/download/1?isBrowser=1',
  })
}

// 附件下载: 根据id下载
export const downloads12 = async (id: string) => {
  return await request.get({
    url: '/api/file/onlyOffice/edit/'+ id,
  })
}

// 附件下载: 根据地址下载
export const downloadsPath = async (data: object) => {
  return await request.download1({
    url: '/file/file/downloadsByPath',
    data: data,
  })
}

// 根据业务id: bizId 和 业务类型: bizType 查询附件信息
export const queryFile = async (data: object) => {
  return await request.download({
    url: '/oauth/anyone/appendix/listByBizId',
    data: data,
  })
}
